package com.homework;

import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;

public class Test04 {
    public static void main(String[] args) {
        LinkedHashSet<String> objects = new LinkedHashSet<>();
        Collections.addAll(objects,"王昭君","王昭君","西施","杨玉环","貂蝉");
        Iterator<String> iterator = objects.iterator();
        while (iterator.hasNext()){
            String next = iterator.next();
            System.out.println(next);
        }
    }
}
